<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //只能调用一次  成功执行后 不会在调用reject包括throw  但其他会执行 
        let p = new Promise((resolve, reject) => {
            resolve('成功')
            console.log('继续执行')
            setTimeout(() => {
                console.log('执行')
            }, 1000)
            throw new Error('不执行')
            throw new TypeError('不执行')
            reject('不执行')
        })
        p.then(res => {
            console.log(res)//成功
        }).catch(err => {
            console.log(err)
        })
    </script>

</body>

</html>